<template>
    <div class="page-intro">
        <div class="content">
            <h1 class="title">你好，我是<span class="highlight">{{ name }}</span></h1>
            <p class="subtitle">{{ tagline }}</p>
            <div class="social-links">
                <a v-for="link in socialLinks" :key="link.name" :href="link.url" target="_blank">
                    <i :class="link.icon"></i>
                </a>
            </div>
        </div>
        <div class="floating-elements">
            <div v-for="i in 5" :key="i" class="floating-circle" :style="getCircleStyle(i)"></div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'

const name = ref('UTTN')
const tagline = ref('开发者 | 艺术家 | 创意思想家')
const socialLinks = ref([
    { name: 'github', url: 'https://www.galgalgal.top/', icon: 'fab fa-github' },
    { name: 'twitter', url: 'https://www.galgalgal.top/', icon: 'fab fa-twitter' },
    { name: 'linkedin', url: 'https://www.galgalgal.top/', icon: 'fab fa-linkedin' }
])

function getCircleStyle(index) {
    const size = Math.random() * 100 + 50
    const colors = ['#ff9eb5', '#ffd3d3', '#ffecf1', '#ffb6c1', '#ffc0cb']
    return {
        width: `${size}px`,
        height: `${size}px`,
        left: `${Math.random() * 80 + 10}%`,
        top: `${Math.random() * 80 + 10}%`,
        backgroundColor: colors[index % colors.length],
        opacity: 0.6,
        animationDuration: `${Math.random() * 10 + 10}s`,
        animationDelay: `${Math.random() * 5}s`
    }
}
</script>

<style scoped>
.page-intro {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.content {
    text-align: center;
    z-index: 2;
    padding: 0 0.6rem;
}

.title {
    font-size: 0.3rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.highlight {
    color: #ff9eb5;
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #ff9eb5;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.title:hover .highlight::after {
    transform: scaleX(1);
    transform-origin: left;
}

.subtitle {
    font-size: 0.5rem;
    margin-bottom: 0.6rem;
    opacity: 0.8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}

.social-links a {
    color: white;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: #ff9eb5;
    transform: translateY(-5px);
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(0.9rem);
    animation: float infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-0.9rem) translateX(0.6rem);
    }
}
</style>